if(!jsx3.lang.Class.forName("ux.cdb.admin.contract.receipt.step1.BaseInfo")) {
    jsx3.lang.Class.defineClass("ux.cdb.admin.contract.receipt.step1.BaseInfo",
            ux.megatron.gui.WizardPanel,
            null,
            function (block) {
                /**
                 * instance initializer
                 * @param strName {String} unique name distinguishing this object from all other JSX GUI objects in the JSX application
                 * @param vntLeft {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntTop {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntWidth {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntHeight {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param strHTML {String} Text/HTML markup to place in the jsx3.gui.Block instance
                 */
                block.prototype.init = function(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML) {
                    //call constructor for super class (the super expects the name of the object and the function that it is an instance of)
                    this.jsxsuper(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML);
                };

                block.prototype.onAfterDeserialize = function() {
                    this.builder = this.getAncestorOfType("ux.cdb.admin.contract.receipt.ReceiptBuilder");
                    this.loaded = false;
                };

                block.prototype.initialize = function(msg) {
                    var me = this;
                    if(!this.loaded) {
                        this.wizard = this.getAncestorOfType("ux.megatron.gui.SteppedWizard");
                        this.builder = this.getAncestorOfType("ux.cdb.admin.contract.receipt.ReceiptBuilder");
                        this.detail = this.get("blkGenericDetail");
                        me = this;
                        ux.cdb.admin.CommonCache.loadCache(['AGENT_BANK', 'EDUCATION_SYS_CODE'], this, function(){
                            var cache = ux.cdb.admin.CommonCache.getInstance();
                            me.get("educationSysCode").get("selValue").setSourceXML(cache.getCache("CommonCache_EDUCATION_SYS_CODE"));
                            me.get("educationSysCode").get("selValue").repaint();
                            me.get("openAccountBankName").get("selValue").setSourceXML(cache.getCache("CommonCache_AGENT_BANK"));
                            me.get("openAccountBankName").get("selValue").repaint();
                        });

                        var cdf = jsx3.xml.CDF.Document.newDocument();
                        var currentYear = (new Date()).getFullYear(), id, text;
                        var unit = ux.megatron.Main.getServer().getDynamicProperty("@cdb@contractReceipt@LearnYear");
                        for(var i=-1; i<=9; i++) {
                            id = (currentYear+i) + "" + (currentYear+i+1);
                            text = (currentYear+i) + "-" + (currentYear+i+1) + unit;
                            cdf.insertRecord({jsxid: id, jsxtext: text});
                        }
                        me.get("feedbackYear").get("selValue").setSourceXML(cdf);
                        me.get("feedbackYear").get("selValue").setValue((currentYear) + "" + (currentYear+1));

                        /**
                        this.detail.addRule(["studentOweTuitionAmt", "studentOweAccommodationAmt"], ["studentOweAmt"], function(o, t) {
                            var amt1 = parseFloat(o[0].getData(), 10);
                            var amt2 = parseFloat(o[1].getData(), 10);
                            if(amt1 && amt2) {
                                t[0].setSimpleData(amt1+amt2);
                            }
                        });
                        */

                        this.detail.addRule(["enrollDate"/* , "educationSysDesc" */], ["graduateDate"], function(o, t) {
                            var val1 = o[0].getData();
                            var val2 = parseInt(o[1].getData(), 10);
                            var ret;
                            if(val1 instanceof Date && !isNaN(val2)) {
                                ret = new Date(val1.getFullYear()+val2, val1.getMonth(), val1.getDate());
                                t[0].setSimpleData(ret);
                            }
                        });


                        //Speical validation
                        this.get("graduateDate").validateEndDay3 = function(val) {
                            if((val instanceof Date) && val < me.get("enrollDate").getData()) {
                                return ux.megatron.Main.getServer().getDynamicProperty("@cdb@contract@ValidationEndDay3");
                            }
                            return null;
                        };

                        this.get("studentOweTuitionAmt").validateAmount6000 = function(val) {
                            if(ux.megatron.util.ValidationManager.isPositiveNumeric(val) &&
                                    (val >= 0 && val <= 6000)) {
                                return null;
                            }
                            return ux.megatron.Main.getServer().getDynamicProperty("@cdb@contract@ValidationAmount6000");
                        };

                    }
                    this.loaded = true;
                    var parent = ux.megatron.Main.getServer().getBodyBlock();
                    this.wizard.newAppBasicInfo = parent.newAppBasicInfo;
                    this.wizard.acct = parent.acct;
/* @JSC :: begin DEBUG */
					jsx3.log('this.wizard.acct C: '+dwr.util.toDescriptiveString(this.wizard.acct,4));
/* @JSC :: end */
                    this.wizard.contactPerson = parent.contractPerson;
                    this.wizard.schoolingInfo = parent.schoolingInfo;

                    if(this.wizard.stepOneInfo) {
                        this.detail.setDataByObject(this.wizard.stepOneInfo);
                    } else if(this.wizard.newAppBasicInfo) {
                        var serverData = {}, attrs;
                        for(i in this.wizard.newAppBasicInfo) {
                            serverData[i] = this.wizard.newAppBasicInfo[i];
                        }
                        attrs = ["educationSysCode", "collegeName", "className", "enrollDate", "graduateDate", "schoolNbr"];
                        for(i=0; i<attrs.length; i++) {
                            serverData[attrs[i]] = this.wizard.schoolingInfo[attrs[i]];
                        }
                        if(this.wizard.acct) {
                            attrs = ["openAccountBankName", "openAccountBranchName", "openAccountSubBranchName", "openAccountOfficeName", "acctName", "acctNbr"];
                            for(i=0; i<attrs.length; i++) {
                                serverData[attrs[i]] = this.wizard.acct[attrs[i]];
                            }
                        }

                        //jsx3.log('this.wizard.contactPerson : ' + dwr.util.toDescriptiveString(this.wizard.contactPerson,3));
						if(this.wizard.contactPerson) {
                            attrs = ["contactPersonName", "contactPersonFixPhone"];
                            for(i=0; i<attrs.length; i++) {
                                serverData[attrs[i]] = this.wizard.contactPerson[attrs[i]];
                            }
                        }
                        currentYear = (new Date()).getFullYear();

                        serverData.feedbackYear = serverData.feedbackYear || (currentYear) + "" + (currentYear+1);
                        
                        /*
                        if(serverData.studentOweTuitionAmt && serverData.studentOweAccommodationAmt) {
                            var amt1 = parseFloat(serverData.studentOweTuitionAmt, 10);
                            var amt2 = parseFloat(serverData.studentOweAccommodationAmt, 10);
                            if(amt1 && amt2) {
                                serverData.studentOweAmt =(amt1+amt2);
                            }
                        }
                        */

                        this.detail.setDataByObject(serverData);
                    }
                };

                block.prototype.onNext = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
                    return this.doValidation() ? null : "NONE";
                };

                block.prototype.onPrev = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
                    return null; // return "NONE" to not advance panels
                };

                block.prototype.onCancel = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
                    this.builder.onClose();
                    return null; // return "NONE" to not advance panels
                };

                block.prototype.onFinish = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL){
                    if(this.doValidation()) { this.builder.saveBuilder(); }
                    return null; // return "NONE" to not advance panels
                };

                block.prototype.onBeforeShow = function(objWIZARD, objBUTTON, objEVENT, strLASTPANEL) {
                    if(!this.getChild(0)) {
                        var me = this;
                        ux.megatron.Main.loadUIResourceAsync(me, "ux.cdb.admin","ux/cdb/admin/contract/receipt/step1/ui/baseInfoContent.xml", me, me.initialize);
                    }
                    return null; // return "NONE" to not advance panels
                };

                block.prototype.onAfterHide = function(objWIZARD, objBUTTON, objEVENT, strNEXTPANEL) {
                    return null; // return "NONE" to not advance panels
                };

                block.prototype.displayTip = function(passed, tip) {
                    if(!passed) {
                        tip = tip || ux.megatron.Main.getServer().getDynamicProperty("@cdb@contractReceipt@TipUnFinishedStep1");
                        this.wizard.getMessageLabel().setText(tip);
                    } else {
                        this.wizard.getMessageLabel().setText("");
                    }
                    return passed;
                };

                block.prototype.doValidation = function() {
                    var errorMsgs = this.detail.doValidate();
                    this.detail = this.get("blkGenericDetail");
                    if(errorMsgs === null) {
                        this.wizard.stepOneInfo = this.detail.getDataAsObject();
                        return this.displayTip(true);
                    } else {
                        var tip = errorMsgs[0].label ? errorMsgs[0].label + ":" +errorMsgs[0].message : errorMsgs[0].message;
                        return this.displayTip(false, tip);
                    }
                };
            }
    );
}
